<?php App::uses('CakeTime', 'Utility');?>
<div class="funcionarios view">
	<div class="row">
		<div class="col-md-12">
			<div class="page-header">
				<h1><?php echo __('Funcionário'); ?></h1>
			</div>
		</div>
	</div>

	<div class="row">

		<div class="col-md-3">
			<div class="actions">
				<div class="panel panel-default">
					<div class="panel-heading">Ações</div>
						<div class="panel-body">
							<ul class="nav nav-pills nav-stacked">
								<li><?php echo $this->Html->link(__('<span class="glyphicon glyphicon-edit"></span>&nbsp&nbsp;Editar Funcionário'), array('action' => 'edit', $funcionario['Funcionario']['id']), array('escape' => false)); ?> </li>
								<li><?php echo $this->Form->postLink(__('<span class="glyphicon glyphicon-remove"></span>&nbsp;&nbsp;Deletar Funcionário'), array('action' => 'delete', $funcionario['Funcionario']['id']), array('escape' => false), __('Tem certeza que deseja deletar o funcionário # %s?', $funcionario['Funcionario']['id'])); ?> </li>
								<li><?php echo $this->Html->link(__('<span class="glyphicon glyphicon-list"></span>&nbsp&nbsp;Listar Funcionários'), array('action' => 'index'), array('escape' => false)); ?> </li>
								<li><?php echo $this->Html->link(__('<span class="glyphicon glyphicon-plus"></span>&nbsp&nbsp;Novo Funcionário'), array('action' => 'add'), array('escape' => false)); ?> </li>
								<li><?php echo $this->Html->link(__('<span class="glyphicon glyphicon-list"></span>&nbsp&nbsp;Listar Cargos'), array('controller' => 'cargos', 'action' => 'index'), array('escape' => false)); ?> </li>
								<li><?php echo $this->Html->link(__('<span class="glyphicon glyphicon-plus"></span>&nbsp&nbsp;Novo Cargo'), array('controller' => 'cargos', 'action' => 'add'), array('escape' => false)); ?> </li>
								<li><?php echo $this->Html->link(__('<span class="glyphicon glyphicon-list"></span>&nbsp&nbsp;Listar Entradas no Caixa'), array('controller' => 'caixas', 'action' => 'index'), array('escape' => false)); ?> </li>
								<li><?php echo $this->Html->link(__('<span class="glyphicon glyphicon-plus"></span>&nbsp&nbsp;Nova entrada no Caixa'), array('controller' => 'caixas', 'action' => 'add'), array('escape' => false)); ?> </li>
							</ul>
						</div><!-- end body -->
				</div><!-- end panel -->
			</div><!-- end actions -->
		</div><!-- end col md 3 -->

		<div class="col-md-9">			
			<table cellpadding="0" cellspacing="0" class="table table-striped">
				<tbody>
				<tr>
		<th><?php echo __('Id'); ?></th>
		<td>
			<?php echo h($funcionario['Funcionario']['id']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Nome'); ?></th>
		<td>
			<?php echo h($funcionario['Funcionario']['nome']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Cpf'); ?></th>
		<td>
			<?php echo h($funcionario['Funcionario']['cpf']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Rg'); ?></th>
		<td>
			<?php echo h($funcionario['Funcionario']['rg']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Data de Nascimento'); ?></th>
		<td>
			<?php echo h(CakeTime::format($funcionario['Funcionario']['data_nasc'], '%d/%m/%Y ')); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Email'); ?></th>
		<td>
			<?php echo h($funcionario['Funcionario']['email']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Telefone'); ?></th>
		<td>
			<?php echo h($funcionario['Funcionario']['telefone']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Celular'); ?></th>
		<td>
			<?php echo h($funcionario['Funcionario']['celular']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Sexo'); ?></th>
		<td>
			<?php echo h($funcionario['Funcionario']['sexo']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Status'); ?></th>
		<td>
			<?php if($funcionario['Funcionario']['status'] == 1) echo 'Ativo'; else echo 'Inativo';  ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Data de Cadastro'); ?></th>
		<td>
			<?php echo h(CakeTime::format($funcionario['Funcionario']['created'], '%d/%m/%Y  às  %H:%M:%S')); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Última Atualização dos dados'); ?></th>
		<td>
			<?php echo h(CakeTime::format($funcionario['Funcionario']['created'], '%d/%m/%Y  às  %H:%M:%S')); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Estado Civil'); ?></th>
		<td>
			<?php echo $funcionario['EstadoCivil']['descricao']; ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Cargo'); ?></th>
		<td>
			<?php echo $this->Html->link($funcionario['Cargo']['nome'], array('controller' => 'cargos', 'action' => 'view', $funcionario['Cargo']['id'])); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Rua'); ?></th>
		<td>
			<?php echo h($funcionario['Endereco']['rua']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Número'); ?></th>
		<td>
			<?php echo h($funcionario['Endereco']['numero']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Bairro'); ?></th>
		<td>
			<?php echo h($funcionario['Endereco']['bairro']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Cep'); ?></th>
		<td>
			<?php echo h($funcionario['Endereco']['cep']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Complemento'); ?></th>
		<td>
			<?php echo h($funcionario['Endereco']['complemento']); ?>
			&nbsp;
		</td>
</tr>
<tr>
		<th><?php echo __('Cidade'); ?></th>
		<td>
			<?php echo h($cidade['Cidade']['nome']);?>
			&nbsp;
		</td>
</tr>

				</tbody>
			</table>

		</div><!-- end col md 9 -->

	</div>
</div>

<div class="related row">
	<div class="col-md-12">
	<h3><?php echo __('Movimentações no caixa pelo funcionário'); ?></h3>
	<?php if (!empty($funcionario['Caixa'])): ?>
	<table cellpadding = "0" cellspacing = "0" class="table table-striped">
	<thead>
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Valor Inicial'); ?></th>
		<th><?php echo __('Data Hora Abertura'); ?></th>
		<th><?php echo __('Data Hora Fechamento'); ?></th>
		<th><?php echo __('Valor Final'); ?></th>
		<th><?php echo __('Funcionario Id'); ?></th>
		<th class="actions"></th>
	</tr>
	<thead>
	<tbody>
	<?php foreach ($funcionario['Caixa'] as $caixa): ?>
		<tr>
			<td><?php echo $caixa['id']; ?></td>
			<td><?php echo $caixa['valor_inicial']; ?></td>
			<td><?php echo $caixa['data_hora_abertura']; ?></td>
			<td><?php echo $caixa['data_hora_fechamento']; ?></td>
			<td><?php echo $caixa['valor_final']; ?></td>
			<td><?php echo $caixa['funcionario_id']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('<span class="glyphicon glyphicon-search"></span>'), array('controller' => 'caixas', 'action' => 'view', $caixa['id']), array('escape' => false)); ?>
				<?php echo $this->Html->link(__('<span class="glyphicon glyphicon-edit"></span>'), array('controller' => 'caixas', 'action' => 'edit', $caixa['id']), array('escape' => false)); ?>
				<?php echo $this->Form->postLink(__('<span class="glyphicon glyphicon-remove"></span>'), array('controller' => 'caixas', 'action' => 'delete', $caixa['id']), array('escape' => false), __('Tem certeza que deseja deletar # %s?', $caixa['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</tbody>
	</table>
<?php endif; ?>

	<div class="actions">
		<?php echo $this->Html->link(__('<span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;Nova entrada no Caixa'), array('controller' => 'caixas', 'action' => 'add'), array('escape' => false, 'class' => 'btn btn-default')); ?> 
	</div>
	</div><!-- end col md 12 -->
</div>
